package org.library.menu;

import org.library.Library;
import org.library.factory.ControllerFactory;
import org.springframework.beans.factory.BeanFactory;

import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

/**
 * 菜单接口
 *
 * @author Chen
 * @since 2023/6/13 14:34
 */
public abstract class Menu {

    protected Library library;

    public void setLibrary(Library library) {
        this.library = library;
    }

    protected final BeanFactory beanFactory;

    protected final Scanner scanner;

    protected final ControllerFactory controllerFactory;

    public Menu(BeanFactory beanFactory) {
        this.beanFactory = beanFactory;
        this.scanner = beanFactory.getBean(Scanner.class);
        this.controllerFactory = beanFactory.getBean(ControllerFactory.class);
    }

    public abstract void menu();

}
